{extend name="public:base" /}
{block name="head"}
<link href="__PUBLIC__/view_res/mobile/css/wshop_company_center.css" type="text/css" rel="Stylesheet" />
<link href="__PUBLIC__/jquery-weui/dist/lib/weui.min.css" type="text/css" rel="Stylesheet" />
<link href="__PUBLIC__/jquery-weui/dist/css/jquery-weui.min.css" type="text/css" rel="Stylesheet" />
<script src="__PUBLIC__/jquery-weui/dist/js/jquery-weui.min.js"></script>
{/block}         
{block name="content"}        
        <input type='hidden' value='{$agent.agent_id}' name='agent_id' />
        
        <header class="bheader" id='comHead' style=''><span>申请提现</span></header>
        <header class="Thead">注意：银行卡（包括银行名称、账户和对应的收款人姓名）和支付宝请必须填写一项</header>
    	<!-- from -->
        <form id="login-wrap">
        	
        	<header class="Thead">提现金额 (提现最小额度 &yen; {$Think.config.cash_num})</header>
            <div style="padding:0 10px;">
                <div class="gs-text">
                    <input type="tel" name="cash" tabindex="1" value="{$agent.no_cash|default=''}" placeholder="提现金额" />
                </div>
            </div>
        	
            <header class="Thead">手机号</header>
            <div style="padding:0 10px;">
                <div class="gs-text">
                    <input type="tel" name="tel" tabindex="2" value="{$agent.tel|default=''}" placeholder="手机号" />
                </div>
            </div>

            <header class="Thead">真实姓名(与银行账户名对应)</header>
            <div style="padding:0 10px;">
                <div class="gs-text">
                    <input type="text" name="name" tabindex="3" value="{$agent.name|default=''}" placeholder="真实姓名" />
                </div>
            </div>      

			<header class="Thead">收款银行</header>
			<div style="padding:0 10px;">
                <div class="gs-text">
                    <input type="text" name="bank_name" tabindex="4" value="{$agent.bank_name|default=''}" placeholder="收款银行" />
                </div>
            </div>
            
			<header class="Thead">收款账户</header>
            <div style="padding:0 10px;">
                <div class="gs-text">
                    <input type="text" name="bank_account" tabindex="5" value="{$agent.bank_account|default=''}" placeholder="收款账户" />
                </div>
            </div>
            
			<header class="Thead">也可以选择支付宝</header>
            <div style="padding:0 10px;">
                <div class="gs-text">
                    <input type="text" name="alipay" tabindex="6" value="{$agent.alipay|default=''}" placeholder="支付宝账号" />
                </div>
            </div>
        </form>
        <div style="padding:10px 10px;">
            <a class="button green" href="javascript:;" id="edit-btn">确认申请</a>
        </div>
{/block}        
{block name="script"}
<script>
$('#edit-btn').click(function(){
	$.post(		
		'{:url("Cash/no_cash")}',	
		$('input[type="tel"],input[type="text"],input[type="hidden"]'),
		function(d){
			if(d.error){
				$.toast(d.error, "forbidden");
			}else if(d.success){
				$.toast(d.success);
				
				setTimeout(function (){
			      history.go(-1);
			    },2000);
			}
		}
	);
});
</script>
{/block}